import Response from './response';

const infor = {
  data1: [{
      name: "小明",
      age: "18岁",
      gender: "男",
      contact: "15270886732",
      figure: [{
        images: "static/images/1.jpg"
      }],
      address: "江西省上饶市玉山县",
      permissions: "普通管理员"
    },
    {
      name: "小红",
      age: "17岁",
      gender: "女",
      contact: "18279347186",
      figure: [{
        images: "static/images/2.jpg"
      }],
      address: "江西省九江市庐山区",
      permissions: "普通管理员"
    },
    {
      name: "诸葛明了",
      age: "20岁",
      gender: "男",
      contact: "13170580695",
      figure: [{
        images: "static/images/3.jpg"
      }],
      address: "江西省余干市星辰县",
      permissions: "超级管理员"
    },
    {
      name: "司马懿",
      age: "28岁",
      gender: "男",
      contact: "15277410101",
      figure: [{
        images: "static/images/timg.gif"
      }],
      address: "东汉末年（魏国）",
      permissions: "普通管理员"
    },
    {
      name: "李四光",
      age: "45岁",
      gender: "男",
      contact: "18956071748",
      figure: [{
        images: "static/images/4.jpg"
      }],
      address: "江西省赣州市兴国县",
      permissions: "普通管理员"
    }
  ],
  data2: [{
      name: "朱晓明",
      age: "21岁",
      gender: "男",
      contact: "18191170680",
      figure: [{
        images: "static/images/5.jpg"
      }],
      address: "陈翔6点半集团",
      permissions: "超级管理员"
    },
    {
      name: "孙悟空",
      age: "2688岁",
      gender: "男",
      contact: "15800822635",
      figure: [{
        images: "static/images/6.jpg"
      }],
      address: "东胜神州傲来国花果山",
      permissions: "普通管理员"
    },
    {
      name: "初代奥特曼",
      age: "20000岁",
      gender: "男",
      contact: "155577086592",
      figure: [{
        images: "static/images/7.jpg"
      }],
      address: "M78星云",
      permissions: "普通管理员"
    },
    {
      name: "艾尼希徳",
      age: "22岁",
      gender: "女",
      contact: "156677086592",
      figure: [{
        images: "static/images/8.jpg"
      }],
      address: "艾欧尼亚大陆",
      permissions: "超级管理员"
    },
    {
      name: "徐长卿",
      age: "23",
      gender: "男",
      contact: "152705086592",
      figure: [{
        images: "static/images/9.png"
      }],
      address: "浙江省金华市义乌市",
      permissions: "普通管理员"
    }
  ],
  data3: [{
      name: "孔明",
      age: "56",
      gender: "男",
      contact: "166877086592",
      figure: [{
        images: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1541996328331&di=661398df1fb14d8c6877963e1a64be52&imgtype=0&src=http%3A%2F%2F7.pic.9ht.com%2Fup%2F2018-5%2F201853018189.jpg"
      }],
      address: "三国时代",
      permissions: "普通管理员"
    },
    {
      name: "QQ斗图one",
      age: "23",
      gender: "男",
      contact: "152577086595",
      figure: [{
        images: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1541997421350&di=d30117d146bd876a31326548ec9fc8c1&imgtype=0&src=http%3A%2F%2Fpic4.zhimg.com%2Fv2-175d4f6a02936d86d0a61f249400248f_b.jpg"
      }],
      address: "浙江省金华市永康市",
      permissions: "普通管理员"
    },
    {
      name: "QQ斗图to",
      age: "23",
      gender: "女",
      contact: "135577016502",
      figure: [{
        images: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1541997421345&di=9139f736f419ff20c381360254ae3e1b&imgtype=0&src=http%3A%2F%2Fwww.ghost64.com%2Fqqtupian%2FzixunImg%2Flocal%2F2017%2F10%2F16%2F15081336334513.gif"
      }],
      address: "浙江省杭州市西湖区",
      permissions: "普通管理员"
    },
    {
      name: "QQ斗图three",
      age: "15",
      gender: "女",
      contact: "155577086592",
      figure: [{
        images: "http://img42.nipic.com/20130327/12124306_143913492166_1.jpg"
      }],
      address: "浙江省温州市",
      permissions: "普通管理员"
    },
    {
      name: "QQ斗图four",
      age: "18",
      gender: "男",
      contact: "152677086592",
      figure: [{
        images: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1541997421336&di=8c266e474ef4abc7aeef81af6654530a&imgtype=0&src=http%3A%2F%2F1.pic.9ht.com%2Fup%2F2018-1%2F2018129103623.jpg"
      }],
      address: "浙江省金华市常山市",
      permissions: "普通管理员"
    }
  ]
}

export default {
  information: config => {
    const {
      roles
    } = JSON.parse(config.body);
    if (roles.roles) {
      var adta;
      if (roles.num == 1) {
        adta = {
          datas: infor.data1,
          danum: roles.num
        }
      } else if (roles.num == 2) {
        adta = {
          datas: infor.data2,
          danum: roles.num
        }
      } else if (roles.num == 3) {
        adta = {
          datas: infor.data3,
          danum: roles.num
        }
      }
      return Response.success(adta);
    } else {
      return Response.fail("01", "0101001（此用户不存在！）")
    }
  }
}
